package blog.spring.db.entity;

// Generated 2015-2-1 19:43:52 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.CascadeType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Type generated by hbm2java
 */
@Entity
@Table(name = "type", catalog = "blog")
public class Type implements java.io.Serializable {

	private Integer typeId;
	private String title;
	private Date createDate;
	private Date updateDate;
	private Integer describeType;
	private Set<ArticleInfo> articleInfos = new HashSet<ArticleInfo>(0);
	private Set<Message> messages = new HashSet<Message>(0);

	public Type() {
	}

	public Type(Integer typeId) {
		super();
		this.typeId = typeId;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "type_id", unique = true, nullable = false)
	public Integer getTypeId() {
		return this.typeId;
	}

	public void setTypeId(Integer typeId) {
		this.typeId = typeId;
	}

	@Column(name = "title")
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@Column(name = "describe_type")
	public Integer getDescribeType() {
		return this.describeType;
	}

	public void setDescribeType(Integer describeType) {
		this.describeType = describeType;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "type")
	public Set<ArticleInfo> getArticleInfos() {
		return this.articleInfos;
	}

	public void setArticleInfos(Set<ArticleInfo> articleInfos) {
		this.articleInfos = articleInfos;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "type")
	public Set<Message> getMessages() {
		return this.messages;
	}

	public void setMessages(Set<Message> messages) {
		this.messages = messages;
	}

}
